//
//  SearchResultCell.m
//  FaceRecognition
//
//  Created by Sylar on 2016/12/1.
//  Copyright © 2016年 Sylar. All rights reserved.
//

#import "SearchResultCell.h"

@implementation SearchResultCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self) {
        
        self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
        
        _avatar = [[UIImageView alloc] initWithFrame:CGRectMake(15, 9, 40, 40)];
        _avatar.layer.cornerRadius = 20;
        _avatar.contentMode = UIViewContentModeScaleAspectFill;
        _avatar.clipsToBounds = YES;
        [self.contentView addSubview:_avatar];
        
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_avatar.frame) + 10, 20, 140, 18.5)];
        _nameLabel.font = [UIFont systemFontOfSize:18];
        _nameLabel.textColor = [UIColor colorWithHexString:@"#3b3b3b"];
        [self.contentView addSubview:_nameLabel];
        
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)creatCell:(FR_StudentRecode_Model *)model {
    
    NSString *logo = model.logo;
    
    if (![logo hasPrefix:@"http"] && logo) {
        
        logo = [REQUESTIMAGEURL stringByAppendingString:logo];
    }
    
    [_avatar sd_setImageWithURL:[NSURL URLWithString:logo]];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
